package com.lovi.io_;

import java.io.*;

/**
 * 指定写来的文件是任意的编码!
 */
public class OutputstreamWriter01 {
    public static void main(String[] args) throws IOException {
        String filePath = "D:\\Desktop\\test\\test02.txt";
        //字节流变成字符流
        OutputStreamWriter writer = new OutputStreamWriter(new FileOutputStream(filePath), "utf-8");
        writer.write("你好你好，lovi！！");
        System.out.println("写入成功！！");
        writer.close();
    }
}
